package top.wilsonlv.jaguar.cloud.websocket.sdk.dto;

import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author lvws
 * @since 2021/12/30
 */
@Data
public class MessageReceiveTopic implements Serializable {

    public static final long serialVersionUID = 1L;

    private Long userId;

    private String userType;

    private String sessionId;

    private String serverInstanceId;

    private WebsocketMessage message;

    private LocalDateTime timestamp = LocalDateTime.now();

    public MessageReceiveTopic() {
    }

    public MessageReceiveTopic(Long userId, String userType, String sessionId, String serverInstanceId) {
        this.userId = userId;
        this.userType = userType;
        this.sessionId = sessionId;
        this.serverInstanceId = serverInstanceId;
    }

    public MessageReceiveTopic(Long userId, String userType, String sessionId, String serverInstanceId, WebsocketMessage message) {
        this.userId = userId;
        this.userType = userType;
        this.sessionId = sessionId;
        this.serverInstanceId = serverInstanceId;
        this.message = message;
    }
}
